﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Base.Master" AutoEventWireup="true" CodeBehind="MainFrame.aspx.cs" Inherits="ETD.WebManagement.Admin.MainFrame" %>

<%@ Import Namespace="ETD.Common.Extension" %>
<%@ Import Namespace="ETD.Business" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>小小安</title>

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <link rel="shortcut icon" href="favicon.ico">
    <link href="<%= this.MapHuiAssets("css/bootstrap.min.css?v=3.3.6") %>" rel="stylesheet">
    <link href="<%= this.MapHuiAssets("css/font-awesome.min.css?v=4.4.0") %>" rel="stylesheet">
    <link href="<%= this.MapHuiAssets("css/animate.css") %>" rel="stylesheet">
    <link href="<%= this.MapHuiAssets("css/style.css?v=4.1.0") %>" rel="stylesheet">
    <link href="<%= this.MapHuiAssets("css/admin.css") %>" rel="stylesheet">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">
    <div id="wrapper">
        <!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="nav-close">
                <i class="fa fa-times-circle"></i>
            </div>
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element">
                            <table style="width: 100%;">
                                <tr>
                                    <td>
                                        <span>
                                            <img alt="image" class="img-circle" style="width: 60px; height: 60px;" src="<%= this.MapMvcAssets("NormalImages/logo.png") %>" />
                                        </span>

                                    </td>
                                    <td>
                                        <span class="block m-t-xs">
                                            <strong class="font-bold" style="color: white;"><%=this.CurrentWebUserSession.UserName %></strong>
                                        </span>
                                        <span class="text-muted text-xs block">
                                            <a class="ChangePassword" data-index="ChangePassword" href="Account/ChangePassword.aspx">修改密码</a> 

                                        </span>

                                    </td>
                                </tr>
                            </table>
                        </div>

                    </li>
                    <% var firstMenuItems = this.CurrentWebUserSession.UserMenuItems.Where(x => x.ParentMenuItemId == null).ToList(); %>
                    <% for (int iFirst = 0; iFirst < firstMenuItems.Count; iFirst++) %>
                    <%{ %>
                    <% var menuItem = firstMenuItems[iFirst]; %>
                    <li>
                        <a href="#">
                            <i class="<%= menuItem.Icon %>"></i>
                            <span class="nav-label"><%= menuItem.MenuItemName %></span>
                            <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <% var secondMenuItems = this.CurrentWebUserSession.UserMenuItems.Where(x => x.ParentMenuItemId == menuItem.MenuItemID).ToList(); %>
                            <% for (int iSecond = 0; iSecond < secondMenuItems.Count; iSecond++) %>
                            <%{ %>
                            <% var subMenuItem = secondMenuItems[iSecond]; %>
                            <li>
                                <a class="J_menuItem" href="<%=subMenuItem.Url %>" data-index="<%= subMenuItem.MenuItemID %>">
                                    <%= subMenuItem.MenuItemName %>
                                </a>
                            </li>
                            <%} %>
                        </ul>

                    </li>
                    <%} %>
                    <%--  <li>
                        <a class="J_menuItem" href="layouts.html"><i class="fa fa-columns"></i><span class="nav-label">布局</span></a>
                    </li>

                    <li>
                        <a href="#"><i class="fa fa-cutlery"></i><span class="nav-label">工具 </span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a class="J_menuItem" href="form_builder.html">表单构建器</a>
                            </li>
                        </ul>
                    </li>--%>
                </ul>
            </div>
        </nav>
        <!--左侧导航结束-->
        <!--右侧部分开始-->
        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                    <div class="navbar-header">
                        <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i></a>
                        <div role="search" class="navbar-form-custom">
                            <div class="form-group">
                                <input type="text" placeholder="请输入您需要查找的内容 …" class="form-control" name="top-search" id="top-search">
                            </div>
                        </div>
                    </div>
                    <ul class="nav navbar-top-links navbar-right">
                        <li class="dropdown">
                            <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
                                <i class="fa fa-envelope"></i><span class="label label-warning">16</span>
                            </a>
                        </li>
                        <li class="dropdown">
                            <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
                                <i class="fa fa-bell"></i><span class="label label-primary">8</span>
                            </a>

                        </li>
                        <%-- <li class="hidden-xs">
                            <a href="index_v1.html" class="J_menuItem" data-index="0"><i class="fa fa-cart-arrow-down"></i>购买</a>
                        </li>--%>
                        <li class="hidden-xs">
                            <a href="javascript:;" id="btnExitSystem" class="right-sidebar-toggle" aria-expanded="false">
                                <i class="fa fa-sign-out"></i>退出
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
            <div class="row content-tabs">
                <button class="roll-nav roll-left J_tabLeft">
                    <i class="fa fa-backward"></i>
                </button>
                <nav class="page-tabs J_menuTabs">
                    <div class="page-tabs-content">
                        <a href="javascript:;" class="active J_menuTab" data-id="/Admin/Wellcome.aspx">首页</a>
                    </div>
                </nav>
                <button class="roll-nav roll-right J_tabRight">
                    <i class="fa fa-forward"></i>
                </button>
                <div class="btn-group roll-nav roll-right">
                    <button class="dropdown J_tabClose" data-toggle="dropdown">
                        关闭操作<span class="caret"></span>

                    </button>
                    <ul role="menu" class="dropdown-menu dropdown-menu-right">
                        <li class="J_tabShowActive"><a>定位当前选项卡</a>
                        </li>
                        <li class="divider"></li>
                        <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                        </li>
                        <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                        </li>
                    </ul>
                </div>
                <a href="javascript:;" class="roll-nav roll-right J_tabRefreshCurrent"><i class="fa fa-refresh"></i>刷新</a>
            </div>
            <div class="row J_mainContent" id="content-main">
                <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/Admin/Wellcome.aspx" frameborder="0" data-id="/Admin/Wellcome.aspx" seamless></iframe>
            </div>
            <%-- <div class="footer">
                <div class="pull-right">
                    &copy; 2014-2017 <a href="http://www.zi-han.net/" target="_blank">zihan's blog</a>
                </div>
            </div>--%>
        </div>
        <!--右侧部分结束-->


    </div>

    <!-- 全局js -->
    <script src="<%= this.MapHuiAssets("js/jquery.min.js?v=2.1.4") %>"></script>
    <script src="<%= this.MapHuiAssets("js/bootstrap.min.js?v=3.3.6") %>"></script>
    <script src="<%= this.MapHuiAssets("js/plugins/metisMenu/jquery.metisMenu.js") %>"></script>
    <script src="<%= this.MapHuiAssets("js/plugins/slimscroll/jquery.slimscroll.min.js") %>"></script>
    <script src="<%= this.MapHuiAssets("js/plugins/layer/layer.min.js") %>"></script>

    <!-- 自定义js -->
    <script src="<%= this.MapHuiAssets("js/hplus.js?v=4.1.0") %>"></script>
    <script type="text/javascript" src="<%= this.MapHuiAssets("js/contabs.js") %>"></script>

    <!-- 第三方插件 -->
    <script src="<%= this.MapHuiAssets("js/plugins/pace/pace.js") %>"></script>

    <script>
        var MainFrame = {};
        MainFrame.init = function () {
            this.initPace();
            this.initEvent();
            this.initContentFrame();
        };
        MainFrame.initEvent = function () {
            var self = this;
            $('#btnExitSystem').click(function () {
                self.exitSystem();
            });
           
        }
        MainFrame.exitSystem = function () {
            //询问框
            layer.confirm('确定要退出系统吗？', {
                btn: ['确定', '取消'], //按钮
                //shade: true //不显示遮罩
            }, function () {
                layer.msg('操作成功', { icon: 1 });
                window.location.href = "<%=ResolveClientUrl("~/Admin/Account/Login.aspx")%>";
            }, function () {
                //layer.msg('奇葩么么哒', { shift: 6 });
            });
        };
        MainFrame.initPace = function () {
            window.setTimeout(function () {
                Pace.stop();
            }, 2000);
        };
        MainFrame.initContentFrame = function () {
            this.resizeContentFrame();

        };
        MainFrame.resizeContentFrame = function () {
            var contentFrameHeight = $(document).height() - 104;
            console.log("(document).height=" + $(document).height() + " contentFrameHeight=" + contentFrameHeight);
            $('#content-main').css('height', contentFrameHeight + 'px');
        };
        $(function () {
            $("body").addClass("fixed-sidebar full-height-layout gray-bg overflow-hidden");
            MainFrame.init();
        });
        $(window).bind("load resize", function () {
            MainFrame.resizeContentFrame();
        });

    </script>
</asp:Content>
